package dashboard;

import java.util.ArrayList;
import java.util.List;

public class SearchController {

	public SearchController()
	{
		
	}
	
	public List<User> findUsers(String querry)
	{
		List<User> searchResults = new ArrayList<User>();
		
		for(User user: UserRegistry.getInstance().getAllUsers())
		{
			if(user.getUserName().contains(querry))
				searchResults.add(user);
			else if(user.getNumber().contains(querry))
				searchResults.add(user);
		}
			
		return searchResults;
	}
}
